﻿// --------------------------------------------------------------------------------------
// 	文 件 名: mtStruct_IpsWorkFlow.cs
// --------------------------------------------------------------------------------------
// 	创建时间: 2021/12/08
// 	版　　本: Version:  1.0.0
// 	版    权: Copyright (C) 2007 - 2021 NUCTECH All Rights Reserved
// 	作    者: chenyu
// --------------------------------------------------------------------------------------
// 	说    明: MTS - 数据结构定义。
// --------------------------------------------------------------------------------------
// 	修改历史:
// 			日期							改动
//		2021.12.08						  创建模块
// --------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text;
using SH;

namespace MTS
{

    using shBoxU3 = shBox3<uint>;
    using shBoxU2 = shBox2<uint>;
    //站点状态
    public enum emIpsStationStatus
    {
        emSTST_Unknown = 0,         //未知状态
        emSTST_Offline = 1,         //离线状态：正常注销
        emSTST_Online = 2,          //在线状态
        emSTST_Initialization = 3,  //初始化状态
        emSTST_Busy = 4,            //忙碌状态：1、要么判图要么开捡；2、历史模式下工作
        emSTST_Ready = 5,           //空闲状态-可分发判图任务
        emSTST_Suspend = 6,         //暂停状态
        emSTST_Lock = 7,            //锁定状态
        emSTST_Exception = 8,       //异常状态。异常退出，超时机制，超过一定时间后恢复为Offline：1、网络异常；2、IPS崩溃
        emSTST_HighRisk = 9,        //高危状态。
    }

    //判图模式
    public enum emJudgeMode
    {
        emJDMD_Unknown = -1,
        emJDMD_Classification = 0,  //分级判图
        emJDMD_Union = 1,           //联合判图
    }

    //图像操作
    public enum emImageManipulation
    {
        emIMMP_Unknown = -1,
        emIMMP_Auto_Save = 0,       //自动保存
        emIMMP_Manual_Save = 1,     //手动保存
        emIMMP_Locking = 2,         //锁定
        emIMMP_Unlocking = 3,       //解锁
        emIMMP_Manual_Marking = 4,  //手动标记
    }

    //任务类型
    public enum emIpsTaskType
    {
        emTKTP_Unknown = -1,
        emTKTP_Judge = 0,           //判图任务
        emTKTP_Check = 1,           //开捡任务
        emTKTP_Confirm = 2,         //确认任务
    }

    //通用操作
    public enum emIpsOperation
    {
        emIPOT_Unknown = 0,
        emIPOT_Retry_Logon = 1,     // 重新登录
    }

    //嫌疑物操作
    public enum emIpsSuspectOperation
    {
        emIPOP_Unknown = 0,
        emIPOP_Add = 1,             // 新增嫌疑物信息
        emIPOP_Delete = 2,          // 删除嫌疑物信息
        emIPOP_Update = 3,          // 更新嫌疑物信息
        emIPOP_Query = 4,           // 查询嫌疑物信息
    }

    //图像判图类型
    public enum emIpsType
    {
        emSTTP_Unknown = 0,         // 嫌疑物操作用于自动识别
        emSTTP_Judge = 1,           // 判图
        emSTTP_Check = 2,           // 开捡
        emSTTP_Confirm = 3,         // 确认
    }

    public enum emHighRiskState
    {
        emHRS_Unknown = 0,
        emHRS_Alarm = 1,            // 启动报警
        emHRS_Relieve = 2,          // 解除报警
    }
    public class mtIpsStationStatus : mtObject, shISerializeable
    {

        emIpsStationStatus m_stationStatus = emIpsStationStatus.emSTST_Unknown;    //站点状态,离线、在线、空闲、忙碌，暂停、异常、高危
        emIPS3DWorkMode m_ipsWorkMode = emIPS3DWorkMode.emIPS3D_Unknown;      //IPS工作模式：历史模式、判图模式、开捡模式
        string m_strTaskId;       //任务Id，唯一。忙碌时的判包信息，任务Id

        public emIpsStationStatus StationStatus { get => m_stationStatus; set => m_stationStatus = value; }
        public emIPS3DWorkMode IpsWorkMode { get => m_ipsWorkMode; set => m_ipsWorkMode = value; }

        public string TaskId { get => m_strTaskId; set => m_strTaskId = value; }
        public mtIpsStationStatus()
        : base(1)
        {
        }

        public mtIpsStationStatus(mtIpsStationStatus other)
            : base(other)
        {
            m_stationStatus = other.m_stationStatus;
            m_ipsWorkMode = other.m_ipsWorkMode;
            m_strTaskId = other.m_strTaskId;
        }

        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_stationStatus);
            sc.serialize(ref m_ipsWorkMode);
            sc.serialize(ref m_strTaskId);

            return sc;
        }

        public override string ToString()
        {
            return $"\r\n 站点状态StationStatus: {StationStatus}" +
                   $"\r\n 工作模式WorkMode: {IpsWorkMode}" +
                   $"\r\n 任务TaskId: {TaskId}";
        }
    }

    /// <summary>
    /// IPS站点连接
    /// </summary>
    public class mtIpsStationInfo : mtObject, shISerializeable
    {
        List<string> m_vecStationIps = new List<string>();      //站点Ip
        emStationType m_stationType = emStationType.emSTT_Unknown;            //站点类型
        string m_strStationName;      //站点名称
        string m_strStationLocation;  //站点位置
        mtIpsStationStatus m_ipsStationStatus = new mtIpsStationStatus();      //站点状态

        public List<string> StationIps { get => m_vecStationIps; set => m_vecStationIps = value; }
        public emStationType StationType { get => m_stationType; set => m_stationType = value; }
        public string StationName { get => m_strStationName; set => m_strStationName = value; }
        public string StationLocation { get => m_strStationLocation; set => m_strStationLocation = value; }
        public mtIpsStationStatus IpsStationStatus { get => m_ipsStationStatus; set => m_ipsStationStatus = value; }


        public mtIpsStationInfo()
        : base(0)
        {
        }

        public mtIpsStationInfo(mtIpsStationInfo other)
        : base(other)

        {
            m_vecStationIps = other.m_vecStationIps;
            m_stationType = other.m_stationType;
            m_strStationLocation = other.m_strStationLocation;
            m_strStationName = other.m_strStationName;
            m_ipsStationStatus = other.m_ipsStationStatus;

        }

        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_vecStationIps);
            sc.serialize(ref m_stationType);
            sc.serialize(ref m_strStationName);
            sc.serialize(ref m_strStationLocation);
            sc.serialize(m_ipsStationStatus);

            return sc;
        }
    }


    /// <summary>
    /// 结论信息
    /// </summary>
    public class mtIpsConclusionInfo : shISerializeable
    {
        string m_strPreStepUserName;      //上一级站点判图/开检/确认的用户名
        emConclusion m_nPreStepConclusion;       //上一级站点判图/开检/确认的结论（安全/嫌疑等）
        string m_strLastStepUserName;     //最后一级站点判图/开检/确认的用户名
        emConclusion m_nLastStepConclusion;      //最后一级站点判图/开检/确认的结论（安全/嫌疑等）

        public string PreStepUserName { get => m_strPreStepUserName; set => m_strPreStepUserName = value; }
        public emConclusion PreStepConclusion { get => m_nPreStepConclusion; set => m_nPreStepConclusion = value; }
        public string LastStepUserName { get => m_strLastStepUserName; set => m_strLastStepUserName = value; }
        public emConclusion LastStepConclusion { get => m_nLastStepConclusion; set => m_nLastStepConclusion = value; }

        public shISerializer serialize(shISerializer sc)
        {

            sc.serialize(ref m_strPreStepUserName);
            sc.serialize(ref m_nPreStepConclusion);
            sc.serialize(ref m_strLastStepUserName);
            sc.serialize(ref m_nLastStepConclusion);

            return sc;
        }
    }

    /// <summary>
    /// 包裹任务
    /// </summary>
    public class mtIpsTask : mtObject, shISerializeable
    {
        mtPicinfo m_imageInfo = new mtPicinfo();              //图片信息
        string m_strTaskId;               //任务Id，唯一
        emIpsType m_ipsType = emIpsType.emSTTP_Unknown;                    //任务类型
        uint m_nJudgeTimeoutTime = 0;        //判图超时时间
        ulong m_nCreateTime = 0;             //创建时间，任务创建时间/扫描开始时间/图像创建时间
        List<mtIpsConclusionInfo> m_vecIpsConclusionInfos = new List<mtIpsConclusionInfo>();    //站点的结论信息，后续可能有多个上级站点，目前只有一个
        emInspectMode m_inspectMode = emInspectMode.emISPM_Unknown;                //判图模式
        mtTotalSuspectOperationResults m_totalSusResults = new mtTotalSuspectOperationResults();//嫌疑物操作历史列表

        public mtPicinfo ImageInfo { get => m_imageInfo; set => m_imageInfo = value; }
        public string TaskId { get => m_strTaskId; set => m_strTaskId = value; }
        public emIpsType IpsType { get => m_ipsType; set => m_ipsType = value; }
        public uint JudgeTimeoutTime { get => m_nJudgeTimeoutTime; set => m_nJudgeTimeoutTime = value; }
        public ulong CreateTime { get => m_nCreateTime; set => m_nCreateTime = value; }
        public List<mtIpsConclusionInfo> IpsConclusionInfos { get => m_vecIpsConclusionInfos; set => m_vecIpsConclusionInfos = value; }
        public emInspectMode InspectMode { get => m_inspectMode; set => m_inspectMode = value; }
        public mtTotalSuspectOperationResults TotalSusResults { get => m_totalSusResults; set => m_totalSusResults = value; }



        public mtIpsTask()
            : base(0)
        {
        }

        public mtIpsTask(mtIpsTask other)
        : base(other)
        {
        }

        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(m_imageInfo);
            sc.serialize(ref m_strTaskId);
            sc.serialize(ref m_ipsType);
            sc.serialize(ref m_nJudgeTimeoutTime);

            sc.serialize(ref m_nCreateTime);
            sc.serialize(m_vecIpsConclusionInfos);
            sc.serialize(ref m_inspectMode);
            sc.serialize(m_totalSusResults);
            return sc;
        }
    }

    /// <summary>
    /// 任务请求
    /// </summary>
    public class mtIpsTaskReq : mtObject, shISerializeable
    {
        string m_strPrn;  // 图像 prn，	请求这个prn的图像 的开检、确认的任务。

        public string Prn { get => m_strPrn; set => m_strPrn = value; }

        public mtIpsTaskReq()
            : base(0)
        {

        }
        public mtIpsTaskReq(mtIpsTaskReq other)
        : base(0)
        {
            m_strPrn = other.m_strPrn;
        }



        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_strPrn);

            return sc;
        }
    }

    /// <summary>
    ///
    /// </summary>
    public class mtIpsImageInfo : mtObject, shISerializeable
    {
        string m_strPrn;          // PRN

        uint m_nRejectTimes;	//被确认站驳回次数

        public string Prn { get => m_strPrn; set => m_strPrn = value; }

        public uint RejectTimes { get => m_nRejectTimes; set => m_nRejectTimes = value; }


        public mtIpsImageInfo()
            : base(0)
        {
        }

        public mtIpsImageInfo(mtIpsImageInfo other)
        : base(other)
        {
            m_strPrn = other.m_strPrn;
            m_nRejectTimes = other.m_nRejectTimes;

        }

        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_strPrn);
            sc.serialize(ref m_nRejectTimes);
            return sc;
        }
    }

    /// <summary>
    /// 图像信息列表（开检、确认）
    /// </summary>
    public class mtIpsImageList : mtObject, shISerializeable
    {
        emIpsType m_ipsType = emIpsType.emSTTP_Unknown;
        List<mtIpsImageInfo> m_vecImages = new List<mtIpsImageInfo>();

        public emIpsType IpsType { get => m_ipsType; set => m_ipsType = value; }
        public List<mtIpsImageInfo> Images { get => m_vecImages; set => m_vecImages = value; }

        public mtIpsImageList()
        : base(0)
        {
        }

        public mtIpsImageList(mtIpsImageList other)
        : base(other)
        {
            m_ipsType = other.m_ipsType;
            m_vecImages = other.m_vecImages;
        }


        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(m_vecImages);
            sc.serialize(ref m_ipsType);

            return sc;
        }
    }


    /// <summary>
    /// 图像操作
    /// </summary>
    public class mtIpsImageOperation : mtObject, shISerializeable
    {
        string m_strPrn;
        ulong m_nImageId = 0;
        emImageManipulation m_imageManipulation = emImageManipulation.emIMMP_Unknown;    //0-自动保存，1-手动保存，2-锁定，3-解锁，4-手动标记

        public string Prn { get => m_strPrn; set => m_strPrn = value; }
        public ulong ImageId { get => m_nImageId; set => m_nImageId = value; }
        public emImageManipulation ImageManipulation { get => m_imageManipulation; set => m_imageManipulation = value; }

        public mtIpsImageOperation()
            : base(0)
        {
        }

        public mtIpsImageOperation(mtIpsImageOperation other)
            : base(other)
        {
        }

        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_strPrn);
            sc.serialize(ref m_nImageId);
            sc.serialize(ref m_imageManipulation);

            return sc;
        }
    }

    /// <summary>
    ///
    /// </summary>
    public class mtIpsImageOperationResult : mtObject, shISerializeable
    {
        mtIpsImageOperation m_imageOperation = new mtIpsImageOperation();
        uint m_Result = 0;

        public mtIpsImageOperation ImageOperation { get => m_imageOperation; set => m_imageOperation = value; }
        public uint Result { get => m_Result; set => m_Result = value; }

        public mtIpsImageOperationResult()
            : base(0)
        {
        }

        public mtIpsImageOperationResult(mtIpsImageOperationResult other)
        : base(other)
        {
            m_imageOperation = other.m_imageOperation;
            m_Result = other.m_Result;
        }


        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(m_imageOperation);
            sc.serialize(ref m_Result);

            return sc;
        }
    }


    /// <summary>
    /// 嫌疑物信息集合
    /// </summary>
    public class mtSusInfoCollection : shISerializeable
    {
        List<mtSusInfo> m_vecSusInfos = new List<mtSusInfo>();

        public List<mtSusInfo> SusInfos { get => m_vecSusInfos; set => m_vecSusInfos = value; }

        public mtSusInfoCollection()
        {

        }
        public mtSusInfoCollection(mtSusInfoCollection other)
        {
            m_vecSusInfos = other.m_vecSusInfos;
        }



        public shISerializer serialize(shISerializer sc)
        {
            sc.serialize(m_vecSusInfos);
            return sc;
        }
    }

    public class mtSusRect2D : shISerializeable
    {
        uint m_nViewId = 0;
        shBoxU2 m_susRect = new shBoxU2();

        public uint ViewId { get => m_nViewId; set => m_nViewId = value; }
        public shBoxU2 SusRect { get => m_susRect; set => m_susRect = value; }

        public mtSusRect2D()
        {

        }

        public mtSusRect2D(mtSusRect2D other)
        {
            m_nViewId = other.m_nViewId;
            m_susRect = other.m_susRect;
        }



        public shISerializer serialize(shISerializer sc)
        {
            sc.serialize(ref m_nViewId);
            sc.serialize(m_susRect);

            return sc;
        }
    }

    /// <summary>
    /// 嫌疑物操作
    /// </summary>
    public class mtSuspectOperation : mtObject, shISerializeable
    {
        string m_strPrn;                        // 图像PRN
        emIpsSuspectOperation m_susOperation = emIpsSuspectOperation.emIPOP_Unknown;                  // 嫌疑物操作
        uint m_nSusLabel = 0;                     // 该物体在标号图中的标号
        uint m_nSusType = 0;                      // 可疑物体类型
        uint m_nSusMarkFlag = 0;                  // 0为自动识别，1为手动标记
        List<mtSusRect2D> m_vecSusRects = new List<mtSusRect2D>();                   // 嫌疑物二维坐标

        public string Prn { get => m_strPrn; set => m_strPrn = value; }
        public emIpsSuspectOperation SusOperation { get => m_susOperation; set => m_susOperation = value; }
        public uint SusLabel { get => m_nSusLabel; set => m_nSusLabel = value; }
        public uint SusType { get => m_nSusType; set => m_nSusType = value; }
        public uint SusMarkFlag { get => m_nSusMarkFlag; set => m_nSusMarkFlag = value; }
        public List<mtSusRect2D> SusRects { get => m_vecSusRects; set => m_vecSusRects = value; }

        public mtSuspectOperation()
        : base(0)
        {
        }

        public mtSuspectOperation(mtSuspectOperation other)
        : base(other)
        {
            m_strPrn = other.m_strPrn;
            m_susOperation = other.m_susOperation;
            m_nSusLabel = other.m_nSusLabel;
            m_nSusType = other.m_nSusType;
            m_nSusMarkFlag = other.m_nSusMarkFlag;
            m_vecSusRects = other.m_vecSusRects;
        }

        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_strPrn);

            sc.serialize(ref m_susOperation);
            sc.serialize(ref m_nSusLabel);
            sc.serialize(ref m_nSusType);
            sc.serialize(ref m_nSusMarkFlag);
            sc.serialize(m_vecSusRects);

            return sc;
        }
    }

    /// <summary>
    /// 嫌疑物判定信息
    /// </summary>
    public class mtSuspectDetermineInfo : mtObject, shISerializeable
    {
        uint m_nUserId = 0;                          // 用户id
        string m_strImagePrn;                     // 图像PRN
        uint m_nSusLabel = 0;                        // 该物体在标号图中的标号
        uint m_nSusType = 0;                     // 可疑物体类型
        uint m_nSusNumber = 0;                       // 嫌疑物数量
        uint m_nSusHandleReasonId = 0;               // 开检站违禁品处理原因Id
        uint m_nSusConfirmConclusionId = 0;          // 确认站审批结论id
        ulong m_nSubmitTime = 0;                        // 结论提交时间
        string m_strSusDes;                       // 嫌疑物备注

        public uint UserId { get => m_nUserId; set => m_nUserId = value; }
        public string ImagePrn { get => m_strImagePrn; set => m_strImagePrn = value; }
        public uint SusLabel { get => m_nSusLabel; set => m_nSusLabel = value; }
        public uint NSusType { get => m_nSusType; set => m_nSusType = value; }
        public uint SusNumber { get => m_nSusNumber; set => m_nSusNumber = value; }
        public uint SusHandleReasonId { get => m_nSusHandleReasonId; set => m_nSusHandleReasonId = value; }
        public uint SusConfirmConclusionId { get => m_nSusConfirmConclusionId; set => m_nSusConfirmConclusionId = value; }
        public ulong SubmitTime { get => m_nSubmitTime; set => m_nSubmitTime = value; }
        public string SusDes { get => m_strSusDes; set => m_strSusDes = value; }

        public mtSuspectDetermineInfo()
            : base(0)
        {
        }

        mtSuspectDetermineInfo(mtSuspectDetermineInfo other)
            : base(other)
        {
            m_nUserId = other.m_nUserId;
            m_strImagePrn = other.m_strImagePrn;
            m_nSusLabel = other.m_nSusLabel;
            m_nSusType = other.m_nSusType;
            m_nSusNumber = other.m_nSusNumber;
            m_nSusHandleReasonId = other.m_nSusHandleReasonId;
            m_nSusConfirmConclusionId = other.m_nSusConfirmConclusionId;
            m_nSubmitTime = other.m_nSubmitTime;
            m_strSusDes = other.m_strSusDes;
        }


        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_nUserId);
            sc.serialize(ref m_strImagePrn);
            sc.serialize(ref m_nSusLabel);
            sc.serialize(ref m_nSusType);
            sc.serialize(ref m_nSusNumber);
            sc.serialize(ref m_nSusHandleReasonId);
            sc.serialize(ref m_nSusConfirmConclusionId);
            sc.serialize(ref m_nSubmitTime);
            sc.serialize(ref m_strSusDes);
            return sc;
        }
    }


    /// <summary>
    /// 嫌疑物操作
    /// </summary>
    public class mtSuspectOperationInfo : mtObject, shISerializeable
    {
        emIpsType m_IpsType = emIpsType.emSTTP_Unknown;                      // 操作类型，0-判图，1-开检，2-确认
        string m_strSusUserName;                 // 用户名称
        string m_strSusTypeName;                 // 违禁品类型名称
        uint m_nSusNumber = 0;                   // 嫌疑物数量
        string m_strSusDes;                      // 嫌疑物备注
        string m_strSusHandleResultName;         // 开检处置结论名称（未开检、放行、拒运、移交）
        string m_strSusHandleReasonName;         // 开检处置原因名称（处置结论的原因）
        ulong m_nSusOperationTime = 0;           // 操作时间，UTC时间戳，毫秒
        string m_strSusConfirmResultName;        // 确认审核结论名称（未审核、接收、拒绝）
        string m_strSusInspectResultName;		 //判图站嫌疑物结论名称 安全，嫌疑 


        public emIpsType IpsType { get => m_IpsType; set => m_IpsType = value; }
        public string SusUserName { get => m_strSusUserName; set => m_strSusUserName = value; }
        public string SusTypeName { get => m_strSusTypeName; set => m_strSusTypeName = value; }
        public uint SusNumber { get => m_nSusNumber; set => m_nSusNumber = value; }
        public string SusDes { get => m_strSusDes; set => m_strSusDes = value; }
        public string SusHandleResultName { get => m_strSusHandleResultName; set => m_strSusHandleResultName = value; }
        public string SusHandleReasonName { get => m_strSusHandleReasonName; set => m_strSusHandleReasonName = value; }
        public ulong SusOperationTime { get => m_nSusOperationTime; set => m_nSusOperationTime = value; }
        public string SusConfirmResultName { get => m_strSusConfirmResultName; set => m_strSusConfirmResultName = value; }
        public string SusInspectResultName { get => m_strSusInspectResultName; set => m_strSusInspectResultName = value; }

        public mtSuspectOperationInfo()
            : base(0)
        {
        }

        public mtSuspectOperationInfo(mtSuspectOperationInfo other)
            : base(other)
        {
            m_IpsType = other.m_IpsType;
            m_strSusUserName = other.m_strSusUserName;
            m_strSusTypeName = other.m_strSusTypeName;
            m_nSusNumber = other.m_nSusNumber;
            m_strSusDes = other.m_strSusDes;
            m_strSusHandleResultName = other.m_strSusHandleResultName;
            m_strSusHandleReasonName = other.m_strSusHandleReasonName;
            m_nSusOperationTime = other.m_nSusOperationTime;
            m_strSusConfirmResultName = other.m_strSusConfirmResultName;
            m_strSusInspectResultName = other.m_strSusInspectResultName;
        }



        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_IpsType);
            sc.serialize(ref m_strSusUserName);
            sc.serialize(ref m_strSusTypeName);
            sc.serialize(ref m_nSusNumber);
            sc.serialize(ref m_strSusDes);
            sc.serialize(ref m_strSusHandleResultName);
            sc.serialize(ref m_strSusHandleReasonName);
            sc.serialize(ref m_nSusOperationTime);
            sc.serialize(ref m_strSusConfirmResultName);
            sc.serialize(ref m_strSusInspectResultName);

            return sc;
        }
    }

    /// <summary>
    /// 单个嫌疑物的操作信息
    /// </summary>

    public class mtSuspectOperationResultInfo : mtObject, shISerializeable
    {
        uint m_nSusLabel = 0;                         // 嫌疑物编号
        uint m_nSusTypeId = 0;                        // 嫌疑物类型Id
        string m_strSusTypeName;                    // 嫌疑物类型名称
        uint m_nSusJudgeConclusionId = 0;           //判图站处理方式Id
        string m_strSusJudgeConclusionName;         //判图站处理方式名称，安全嫌疑
        uint m_nSusHandleMethodId = 0;                // 开检站的处理方式Id
        string m_strSusHandleMethodName;            // 开检站的处理方式名称
        uint m_nSusExamineConclusionId = 0;           // 确认站的审批结论id
        string m_strSusExamineConclusionName;       // 确认站的审批结论名称
        uint m_nSusMarkFlag = 0;                      // 0为自动标记，1为手动标记
        string m_strSusManualClearFlag;             // 0为自动识别嫌疑物, 1为被站点手动清除
        emIpsSuspectOperation m_susOperation = emIpsSuspectOperation.emIPOP_Unknown;                  // 嫌疑物操作
        List<mtSusRect2D> m_vecSusRects = new List<mtSusRect2D>();                       // 嫌疑物二维坐标
        List<mtSuspectOperationInfo> m_vecSusOperations = new List<mtSuspectOperationInfo>();                  // 嫌疑物操作信息


        public uint SusLabel { get => m_nSusLabel; set => m_nSusLabel = value; }
        public uint SusTypeId { get => m_nSusTypeId; set => m_nSusTypeId = value; }
        public string SusTypeName { get => m_strSusTypeName; set => m_strSusTypeName = value; }
        public uint SusHandleMethodId { get => m_nSusHandleMethodId; set => m_nSusHandleMethodId = value; }
        public string SusHandleMethodName { get => m_strSusHandleMethodName; set => m_strSusHandleMethodName = value; }
        public uint SusExamineConclusionId { get => m_nSusExamineConclusionId; set => m_nSusExamineConclusionId = value; }
        public string SusExamineConclusionName { get => m_strSusExamineConclusionName; set => m_strSusExamineConclusionName = value; }
        public uint SusMarkFlag { get => m_nSusMarkFlag; set => m_nSusMarkFlag = value; }
        public string SusManualClearFlag { get => m_strSusManualClearFlag; set => m_strSusManualClearFlag = value; }
        public List<mtSusRect2D> SusRects { get => m_vecSusRects; set => m_vecSusRects = value; }
        public List<mtSuspectOperationInfo> SusOperations { get => m_vecSusOperations; set => m_vecSusOperations = value; }
        public emIpsSuspectOperation SusOperation { get => m_susOperation; set => m_susOperation = value; }
        public uint SusJudgeConclusionId { get => m_nSusJudgeConclusionId; set => m_nSusJudgeConclusionId = value; }
        public string SusJudgeConclusionName { get => m_strSusJudgeConclusionName; set => m_strSusJudgeConclusionName = value; }

        public mtSuspectOperationResultInfo()
            : base(0)
        {
        }

        public mtSuspectOperationResultInfo(mtSuspectOperationResultInfo other)
        : base(other)
        {
            m_nSusLabel = other.m_nSusLabel;
            m_nSusTypeId = other.m_nSusTypeId;
            m_strSusTypeName = other.m_strSusTypeName;
            m_nSusJudgeConclusionId = other.m_nSusJudgeConclusionId;
            m_strSusJudgeConclusionName = other.m_strSusJudgeConclusionName;
            m_nSusHandleMethodId = other.m_nSusHandleMethodId;
            m_strSusHandleMethodName = other.m_strSusHandleMethodName;
            m_nSusExamineConclusionId = other.m_nSusExamineConclusionId;
            m_strSusExamineConclusionName = other.m_strSusExamineConclusionName;
            m_nSusMarkFlag = other.m_nSusMarkFlag;
            m_strSusManualClearFlag = other.m_strSusManualClearFlag;
            m_vecSusRects = other.m_vecSusRects;
            m_vecSusOperations = other.m_vecSusOperations;
            m_susOperation = other.m_susOperation;
        }


        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_nSusLabel);
            sc.serialize(ref m_nSusTypeId);
            sc.serialize(ref m_strSusTypeName);
            sc.serialize(ref m_nSusJudgeConclusionId);
            sc.serialize(ref m_strSusJudgeConclusionName);
            sc.serialize(ref m_nSusHandleMethodId);
            sc.serialize(ref m_strSusHandleMethodName);
            sc.serialize(ref m_nSusExamineConclusionId);
            sc.serialize(ref m_strSusExamineConclusionName);
            sc.serialize(ref m_nSusMarkFlag);
            sc.serialize(ref m_strSusManualClearFlag);
            sc.serialize(m_vecSusRects);
            sc.serialize(m_vecSusOperations);
            sc.serialize(ref m_susOperation);

            return sc;
        }
    }

    /// <summary>
    /// 单个图像的所有嫌疑物的操作信息
    /// </summary>
    public class mtTotalSuspectOperationResults : mtObject, shISerializeable
    {
        List<mtSuspectOperationResultInfo> m_vecSuspectConclusionResults = new List<mtSuspectOperationResultInfo>();
        string m_strPackagePrn;
        mtIpsConclusionInfo m_packageConclusionInfo = new mtIpsConclusionInfo();
        List<mtSusInfo> m_vecManualSubSusInfos = new List<mtSusInfo>();      //各个站点新增手动标记，嫌疑物

        public List<mtSuspectOperationResultInfo> SuspectConclusionResults { get => m_vecSuspectConclusionResults; set => m_vecSuspectConclusionResults = value; }
        public string PackagePrn { get => m_strPackagePrn; set => m_strPackagePrn = value; }
        public mtIpsConclusionInfo PackageConclusionInfo { get => m_packageConclusionInfo; set => m_packageConclusionInfo = value; }

        public List<mtSusInfo> ManualSubSusInfos { get => m_vecManualSubSusInfos; set => m_vecManualSubSusInfos = value; }
        public mtTotalSuspectOperationResults()
            : base(0)
        {
        }

        public mtTotalSuspectOperationResults(mtTotalSuspectOperationResults other)
            : base(other)
        {
            m_vecSuspectConclusionResults = other.m_vecSuspectConclusionResults;
            m_strPackagePrn = other.m_strPackagePrn;
            m_packageConclusionInfo = other.m_packageConclusionInfo;
        }



        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(m_vecSuspectConclusionResults);
            sc.serialize(ref m_strPackagePrn);
            sc.serialize(m_packageConclusionInfo);
            sc.serialize(m_vecManualSubSusInfos);

            return sc;
        }
    }

    /// <summary>
    /// 判图结果
    /// </summary>
    public class mtIpsResult : mtObject, shISerializeable
    {
        string m_strTaskId;       // 任务Id，唯一
        ulong m_nPicId = 0;           // 图像id
        string m_strPackagePrn;    // PRN
        emConclusion m_conclusion = emConclusion.emSC_Unknown;    // 整包结论

        emIpsType m_ipsType;            // 任务类型
        ulong m_nStartTime = 0;     // 开始时间，UTC时间戳，毫秒
        ulong m_nEndTime = 0;           // 结束时间，UTC时间戳，毫秒
        string m_strTotalSusInfo;  // 所有的嫌疑物结论信息（json字符串）

        mtTotalSuspectOperationResults m_totalSusResults = new mtTotalSuspectOperationResults();


        public string TaskId { get => m_strTaskId; set => m_strTaskId = value; }
        public ulong PicId { get => m_nPicId; set => m_nPicId = value; }
        public string PackagePrn { get => m_strPackagePrn; set => m_strPackagePrn = value; }
        public emConclusion Conclusion { get => m_conclusion; set => m_conclusion = value; }
        public emIpsType IpsType { get => m_ipsType; set => m_ipsType = value; }
        public ulong StartTime { get => m_nStartTime; set => m_nStartTime = value; }
        public ulong EndTime { get => m_nEndTime; set => m_nEndTime = value; }
        public string TotalSusInfo { get => m_strTotalSusInfo; set => m_strTotalSusInfo = value; }
        public mtTotalSuspectOperationResults TotalSusResults { get => m_totalSusResults; set => m_totalSusResults = value; }

        public mtIpsResult()
        : base(0)
        {
        }

        public mtIpsResult(mtIpsResult other)
        : base(other)
        {
            m_nPicId = other.m_nPicId;
            m_strPackagePrn = other.m_strPackagePrn;
            m_conclusion = other.m_conclusion;
            m_strTaskId = other.m_strTaskId;
            m_ipsType = other.m_ipsType;
            m_nStartTime = other.m_nStartTime;
            m_nEndTime = other.m_nEndTime;
            m_strTotalSusInfo = other.m_strTotalSusInfo;
            m_totalSusResults = other.m_totalSusResults;
        }


        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);

            sc.serialize(ref m_nPicId);
            sc.serialize(ref m_strPackagePrn);
            sc.serialize(ref m_conclusion);
            sc.serialize(ref m_strTaskId);

            sc.serialize(ref m_ipsType);
            sc.serialize(ref m_nStartTime);
            sc.serialize(ref m_nEndTime);

            sc.serialize(ref m_strTotalSusInfo);
            sc.serialize(m_totalSusResults);

            return sc;
        }
    }

    /// <summary>
    /// 通知高危报警状态
    /// </summary>
    public class mtIpsHighRiskState : mtObject, shISerializeable
    {
        emHighRiskState m_highRiskState = new emHighRiskState();
        string m_strHighRiskPrn;
        string m_strHighRiskUser;
        ulong m_nHighRiskTime = 0;

        public emHighRiskState HighRiskState { get => m_highRiskState; set => m_highRiskState = value; }
        public string HighRiskPrn { get => m_strHighRiskPrn; set => m_strHighRiskPrn = value; }
        public string HighRiskUser { get => m_strHighRiskUser; set => m_strHighRiskUser = value; }
        public ulong HighRiskTime { get => m_nHighRiskTime; set => m_nHighRiskTime = value; }

        public mtIpsHighRiskState()
        : base(0)
        {
        }

        public mtIpsHighRiskState(mtIpsHighRiskState other)
            : base(other)
        {
            m_highRiskState = other.m_highRiskState;
            m_strHighRiskPrn = other.m_strHighRiskPrn;
            m_strHighRiskUser = other.m_strHighRiskUser;
            m_nHighRiskTime = other.m_nHighRiskTime;
        }



        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_highRiskState);
            sc.serialize(ref m_strHighRiskPrn);
            sc.serialize(ref m_strHighRiskUser);
            sc.serialize(ref m_nHighRiskTime);

            return sc;
        }
    }

    /// <summary>
    /// 确认站图像结论
    /// </summary>
    public class mtIpsComfirmConclusion : mtObject, shISerializeable
    {
        string m_strPrn;
        string m_strComirmUserId;
        string m_strConclusionName;
        emConclusion m_conclusion = emConclusion.emSC_Unknown;

        public string Prn { get => m_strPrn; set => m_strPrn = value; }
        public string ComirmUserId { get => m_strComirmUserId; set => m_strComirmUserId = value; }
        public string ConclusionName { get => m_strConclusionName; set => m_strConclusionName = value; }
        public emConclusion Conclusion { get => m_conclusion; set => m_conclusion = value; }

        public mtIpsComfirmConclusion()
        : base(0)
        {
        }

        public mtIpsComfirmConclusion(mtIpsComfirmConclusion other)
        : base(other)
        {
            m_strPrn = other.m_strPrn;
            m_strComirmUserId = other.m_strComirmUserId;
            m_strConclusionName = other.m_strConclusionName;
            m_conclusion = other.m_conclusion;
        }



        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_strPrn);
            sc.serialize(ref m_strComirmUserId);
            sc.serialize(ref m_strConclusionName);
            sc.serialize(ref m_conclusion);

            return sc;
        }
    }
}
